﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    צור תגובה
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HeadContent" runat="server">

    <script src="../../Scripts/tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>

    <script type="text/javascript">
        function myCustomInitInstance(inst) {
            inst.setContent(document.getElementsByName('text').item(0).value);
        }

        tinyMCE.init({ theme: "advanced",
            mode: "exact",
            elements: "mce",
            plugins: "fullpage,paste,table,contextmenu,style,advlink",
            theme_advanced_buttons1_add_before: "insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
            theme_advanced_buttons2_add_before: "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
            theme_advanced_buttons3_add_before: "hr,removeformat,visualaid,separator,sub,sup,separator,charmap",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_more_colors: true,
            init_instance_callback: "myCustomInitInstance",
            content_css: "/Content/tinymce.css"
        });

        function SerializeMCE() {
            var html = tinyMCE.activeEditor.serializer.serialize(tinyMCE.activeEditor.dom.select('body')[0]);
            document.getElementsByName('text').item(0).value = html;
        }

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        צור תגובה</h2>
    <% using (Html.BeginForm("CreateResponse", "Forum", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "SerializeMCE()" }))
       {%>
    <fieldset>
        <legend>הוסף תגובה</legend>
        <input type="hidden" name="text" value=" " />
        <% Response.Write("<input type=\"hidden\" value=\"" + Model + "\" name=\"p_id\"/>");%>
        <div>
            <p>
                <label for="title">
                    כותרת:</label>
                <%= Html.TextBox("title") %>
                <%= Html.ValidationMessage("title") %>
            </p>
            <div>
                <%=Html.TextArea("mce", new {rows="15", cols="5", id="mce"})%>
            </div>
            <label for="image">העלאת קובץ:</label>
              <input type="file" name="image" size="40" />
              <p>
                <label for="movie">
                    לשבץ סרטון:</label>
                <%= Html.TextBox("movie") %>
               
            </p>
        </div>
        <div class="floatleft">
            <span class="feedbackButton">
                <input type="submit" value="פרסם" /></span> 
        </div>
    </fieldset>
    <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Right" runat="server">
</asp:Content>
